#ifndef __INIT_H__
#define __INIT_H__

// Includes
#include <PA9.h>       // Include for PA_Lib
#include "efs_lib.h" // be sure to put the efs_lib.c/.h files in your source diectory and #include
#include <stdlib.h>  //for random number generator

#include "gfx/all_gfx.h"
#include "gfx/all_gfx.c"


//sound
#include "SM.h"
#include "gun.h"
#include "chainsaw.h"
#include "swoosh.h"
#include "ping.h"


#include "Avatar.h"
#include "Menu.h"
#include "InitMonster.h"
#include "Monster.h"

#define wall 64799
#define black 32768
#define yellow 33791
#define white 65535

//DECLARE GLOBAL VARIABLES
//--------------------------
//--------------------------
u16 NUMBER_OF_SPRITES = 11;

u16 map = 10;				//map number is represented by a 2-digit number
//the tens digit represents the map image
//the ones digit represents the map scrolling for that area
s32 scrollOffsetX = 0, scrollOffsetY = 0;	//offset for map scrolling
char scrCtrl = '0';

int selectCount = 0;
char text[1000];
bool dash = false, moving = false, touchSprite = false, guardL = false, guardR = false;
s32 x = 120, y = 170;					//world coordinates
s32 oldX = 0, oldY = 0;
s32 styStartX = 0, styStartY = 0;	//initial stylus location at Newpress
s32 sprStartX = 50, sprStartY = 50; //initial sprite position
s32 spriteX = 0, spriteY = 0;		//sprite position
u16 direction = 0; 					//direction the sprite is facing
u16 counter = 0;					//counter used in for loops
u16 chestCount = 5;					//number of chests
u16 chestCycle = 5;					//cycle for chest animation
u16 guardCycle = 30; 				//how many cycles the sprite should stay in the guard positon
u16 dashCycle = 24;			 		//how many cycles to dash
s32 dashDist = 7; 					//distance to dash per cycle
									//only moves have this distance each frame
s32 kickRunDist = 0;				//distance to run for a kick
u64 adjShotDist = 400; 				//adjust how accurate tap has to be
									//note, this value is the square of the actual distance
u64 distToChest = 1000;				//how close the player must be to open a chest
									//note, this value is the square of the actual distance
u16 vertShotLimit = 0;				//max and min vertical values above and below sprite for a 
									//tap to be valid when shooting
u16 dashCost = 5;					//stamina cost of dash
u16 guardCost = 3;					//stamina cost of guard
u16 kickCost = 1;					//stamina cost of kick
u16 staminaBoost = 1;				//stamina boost for each cycle player is resting
								
u8  gameClock = 0;					//master game clock
u32 gameSeconds = 0;				//seconds
								
u8  staminaClock = 0;				//a clock for knowing when to restore stamina
u32 staminaSeconds = 0;				//seconds of "staminaClock"
u32 staminaRestore = 5;				//restore time for stamina

u8  stamBoostClock = 0;				//a clock for the stamina boost stone's recharge
u32 stamBoostSeconds = 0;			//seconds
//u32 stamBoostRestore = 10;			//recharge time for boost stone
u32 stamBoostRestore = 120;			//recharge time for boost stone
bool stamRecharge = false;			//is stone recharging?

u8  hpBoostClock = 0;				//a clock for the hp boost stone's recharge
u32 hpBoostSeconds = 0;				//seconds
//u32 hpBoostRestore = 10;			//recharge time for boost stone
u32 hpBoostRestore = 90;			//recharge time for boost stone
bool hpRecharge = false;			//is stone recharging?

u8  attBoostClock = 0;				//a clock for the attack boost stone's recharge
u32 attBoostSeconds = 0;			//seconds
//NOTE: make sure attBoostRestore is long enough for previous boost to wear off
//Restore >= FullLength + Boost*(DecLength*decBoost)
//u32 attBoostRestore = 50;			//recharge time for boost stone
u32 attBoostRestore = 240;			//recharge time for boost stone
//u32 attBoostFullLength = 10;		//amount of time for full boost to last
u32 attBoostFullLength = 30;		//amount of time for full boost to last
u32 attBoostDecLength = 5;			//amount of time to between decrements
//u16 attBoost = 5;					//boost amount
u16 attBoost = 10;					//boost amount
u16 decAttBoost = 1;				//amount to decrement by
bool attRecharge = false;			//is stone recharging?

u8  defBoostClock = 0;				//a clock for the defense boost stone's recharge
u32 defBoostSeconds = 0;			//seconds
//NOTE: make sure defBoostRestore is long enough for previous boost to wear off
//Restore >= FullLength + Boost*(DecLength*decBoost)
//u32 defBoostRestore = 50;			//recharge time for boost stone
u32 defBoostRestore = 240;			//recharge time for boost stone
//u32 defBoostFullLength = 10;		//amount of time for full boost to last
u32 defBoostFullLength = 30;		//amount of time for full boost to last
u32 defBoostDecLength = 5;			//amount of time to between decrements
//u16 defBoost = 5;					//boost amount
u16 defBoost = 10;					//boost amount
u16 decDefBoost = 1;				//amount to decrement by
bool defRecharge = false;			//is stone recharging?

u8  specBoostClock = 0;				//a clock for the special boost stone's recharge
u32 specBoostSeconds = 0;			//seconds
//u32 specBoostRestore = 10;			//recharge time for boost stone
u32 specBoostRestore = 360;			//recharge time for boost stone
bool specRecharge = false;			//is stone recharging?

bool slotFull[5];					//used so multiple stones are NOT equipped
									//in the same slot
int slotX[5], slotY[5];			//X and Y position for equipping each stone

bool touchButton = false;			//for stylus, to tell if a  button is touched
u32  buttonTime = 0;				//time since button was last touched
u32  buttonRelease = 250;			//min. # of milliseconds between button press and next stylus action
bool stoneOneEquip = false;			//if first stone is equipped
bool stoneTwoEquip = false;			//if second stone is equipped
bool stoneThreeEquip = false;		//if third stone is equipped
bool stoneFourEquip = false;		//if fourth stone is equipped
bool stoneFiveEquip = false;		//if fifth stone is equipped

u16 kickNum = 0;			//kick number
u16 kickCount = 0;			//current kick cout
bool isKicked = false;		//flag
u8  kickClock = 0;			//timer for the kick combo
u32 kickTime = 0;			//time kick was last touched
u32 kickInc = 750;			//max time increment between kicks
u16 kickStart = 0;			//start location of kick

u32 shotTime = 0;			//store time for shot
u32 shotNext = 750;			//time between shots
u32 shotInc = 1000;			//return to normal stance
bool isShot = false;		//flag

bool monKick = false;

bool chest1 = false;
s32 chest1X = 650, chest1Y = 130;	//spawn location of chest
s32 chest2X = 50, chest2Y = 380;	//spawn location of chest


u32 fontOneTime = 0;
u32 fontOneInc = 1000;
u32 fontTwoTime = 0;
u32 fontTwoInc = 1000;
u32 fontThreeTime = 0;
u32 fontThreeInc = 1000;

int fontOneMonNo = 999; //use 999 as default, since 0 is used as a monster number
int fontTwoMonNo = 999;
int fontThreeMonNo = 999;

u32 hitOneInc = 400;
u32 hitTwoInc = 400;
u32 hitThreeInc = 400;

u32 playerfontOneTime = 0;
u32 playerfontOneInc = 1000;
u32 playerfontTwoTime = 0;
u32 playerfontTwoInc = 1000;
u32 playerfontThreeTime = 0;
u32 playerfontThreeInc = 1000;

u32 playerhitOneInc = 400;
u32 playerhitTwoInc = 400;
u32 playerhitThreeInc = 400;

int dotX = 0, oldDotX = 0;
int dotY = 0, oldDotY = 0;

int lastX = x, currentX = x;
int lastY = y, currentY = y;


//Create Player object as a Global so all functions can access it
Avatar player;
int avSprNo = 0;

const int monSize = 2;
s32 mon1X = 650, mon1Y = 170;
s32 mon2X = 250, mon2Y = 220;
//Enemy bg1(1, mon1X, mon1Y);
Enemy* bg[monSize];
//bg[0] = new Enemy(1, mon1X, mon1Y);
int monX[monSize], monY[monSize];// = 650, mon1Y = 170;
int monSprStart = 40;


//sound/music
int i, rate = 0, newrate = 0;
bool mp3_mode = true, autopan = false;
u8 lastsfx = 0, usage = 0, pan = 0, fx_mode = AS_SURROUND;


//INITIALIZE DATA TO START PROGRAM//
//--------------------------
//--------------------------
void StartInit()
{
	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL
	
	
	
	if(EFS_Init(EFS_AND_FAT | EFS_DEFAULT_DEVICE, NULL))  // Standard EFS and libfat initialization
	{
		//PA_OutputSimpleText(0, 0, 4, "EFS init okay!");

		PA_FatInitAllBuffers(); // Initialize all the memory buffers used by the FAT loading system

		PA_FatSetBasePath("data");  // Set a base path from the EFS root to load your asset files from
									  // Within this base asset folder:
								  //      all background binaries should be in /bg/
								  //      2D and 3D sprite and palette binaries in /sprites/
								  //      and RAW format sound files in /sfx/
								  
		
	}
	PA_InitText(0, 0);
	PA_InitText(1, 0);  // Initialise the text system on the top screen
	PA_Init8bitBg(0, 0); // We'll draw the characters on the screen...

	PA_SetBgPalCol(0, 1, PA_RGB(31, 31, 31)); // Set the writing color to white

}





//INITIALIZE DATA TO RUN GAME//
//--------------------------
//--------------------------
void GameInit()
{
		
	// Init AS_Lib for mp3
	PA_VBLFunctionInit(AS_SoundVBL);
	AS_Init(AS_MODE_MP3 | AS_MODE_SURROUND | AS_MODE_16CH);
	AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND);


	srand(time(NULL)); //init random number generator

	//Initialize timer system and start master game clock
	StartTime(true);
	gameClock = NewTimer(true);
	StartTimer(gameClock);

	//Initialize and Start Stamina Clock
	staminaClock = NewTimer(true);
	StartTimer(staminaClock);
	
	//Initialize and Start Kick Clock
	kickClock = NewTimer(true);
	StartTimer(kickClock);
	
	//initialize and start Stone/Boost Clocks
	hpBoostClock = NewTimer(true);
	StartTimer(hpBoostClock);
	stamBoostClock = NewTimer(true);
	StartTimer(stamBoostClock);
	attBoostClock = NewTimer(true);
	StartTimer(attBoostClock);
	defBoostClock = NewTimer(true);
	StartTimer(defBoostClock);
	specBoostClock = NewTimer(true);
	StartTimer(specBoostClock);

	
	
	//SET BACKGROUND
	//-----------------------------------------------------------------
	//Load Background with its palette
	PA_FatEasyBgLoad(0, 1, "environmentMap01");
	PA_LargeScrollXY(0, // Screen
					1, // Background number
					120, // X scroll
					170); // Y scroll
	
	PA_EasyBgLoad(0, //screen
					2, //background (0-3)
					collisionMap01);	//background name
					
	//Use Scroll the background to adust location
	PA_EasyBgScrollXY(0, // Screen
					2, // Background number
					120, // X scroll
					170); // Y scroll
					
					
	//PA_FatEasyBgLoad(1, 0, "controlsMenu");
	
					
	//load gui background and palette
	//PA_EasyBgLoad(0, 0, guiInterface2);
	
	

					
					
	//CREATE PLAYER DATA
	//-----------------------------------------------------------------

	//load sprite palette and create on screen
	PA_LoadSpritePal(0, //screen
					0, //palette number
					(void*)Avatar_Pal); //palette name

	PA_CreateSprite(0, //screen
					avSprNo, //sprite number
					(void*)AvatarAllReel64x5440_Sprite, //sprite name
					OBJ_SIZE_64X64, //sprite size
					1, //256 color mode
					0, //palette number
					sprStartX, sprStartY); //x and y position
	PA_SetSpritePrio(0, avSprNo, 1); //set sprite to background 1
	
	
	
	
	//========== slime ==========//
	monX[0] = 650; monY[0] = 170;
	monX[1] = 350; monY[1] = 200;
	
	
	PA_LoadSpritePal(0, //screen
					11, //palette number
					(void*)Slime_Pal); //palette name
					
					

	int n = 0;
	
	for(int i = monSprStart; i < (monSprStart + monSize); i++)
	{
	
		PA_CreateSprite(0, //screen
						i, //sprite number
						(void*)SlimeStrip64x2048_Sprite, //sprite name
						OBJ_SIZE_64X64, //sprite size
						1, //256 color mode
						11, //palette number
						monX[n], monY[n]); //x and y position
		PA_SetSpritePrio(0, i, 1); //set sprite to background 
		PA_SetSpriteAnimFrame(0,i,0);
		
		
		bg[n] = new Enemy(1, monX[n], monY[n]);
		//bg[n] = new Enemy(1, mon1X, mon1Y);
		
		n++;
	}
	
	
	
					
	//CREATE STONES
	//-----------------------------------------------------------------

	//load stone palette 
	PA_LoadSpritePal(0, 1, (void*)Stones_Pal);
	//load button palette
	PA_LoadSpritePal(0, 3, (void*)Buttons_Pal);
	//load palette for guages (hp, stamina, special)
	PA_LoadSpritePal(0, 4, (void*)Guages_Pal);
	
	//hp guage
	PA_CreateSprite(0, 13, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 32, 159);
	PA_SetSpriteAnim(0, 13, 27);
	//stamina guage
	PA_CreateSprite(0, 14, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 32, 159);
	PA_SetSpriteAnim(0, 14, 55);
	//special guage
	PA_CreateSprite(0, 15, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 32, 159);
	PA_SetSpriteAnim(0, 15, 56);
	
	
	//create gui out of sprites
	PA_CreateSprite(0, 16, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 0, 160);
	PA_SetSpriteAnim(0, 16, 84);
	//PA_SetSpritePrio(0, 16, 1);
	PA_CreateSprite(0, 17, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 64, 160);
	PA_SetSpriteAnim(0, 17, 85);
	//PA_SetSpritePrio(0, 17, 1);
	PA_CreateSprite(0, 18, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 128, 160);
	PA_SetSpriteAnim(0, 18, 86);
	//PA_SetSpritePrio(0, 18, 1);
	PA_CreateSprite(0, 19, (void*)AllGuageStrip64x2784_Sprite, OBJ_SIZE_64X32,
			1, 4, 192, 160);
	PA_SetSpriteAnim(0, 19, 86);
	//PA_SetSpritePrio(0, 19, 1);
	
	//create button
	PA_CreateSprite(0, 11, (void*)buttons64x480_Sprite, OBJ_SIZE_64X32,
						1, 3, 64, 64);
	PA_CreateSprite(0, 12, (void*)buttons64x480_Sprite, OBJ_SIZE_64X32,
						1, 3, 128, 64);
	//first frame is invisible
	PA_SetSpriteAnim(0, 11, 0);
	PA_SetSpriteAnim(0, 12, 0);
	

	//load chest palette 
	PA_LoadSpritePal(0, 2, (void*)Items_Pal);
	
	//Create Chests
	//initialize offscreen somewhere (anywhere)
	PA_CreateSprite(0, 6, (void*)chests32x256_Sprite, OBJ_SIZE_32X32,
						1, 2, 300, 200);
	PA_SetSpriteAnim(0, 6, 0);
	PA_SetSpritePrio(0, 6, 1);
	
	PA_CreateSprite(0, 7, (void*)chests32x256_Sprite, OBJ_SIZE_32X32,
						1, 2, 300, 200);
	PA_SetSpriteHflip(0, 7, 0); //disable flip
	PA_SetSpriteAnim(0, 7, 4);
	PA_SetSpritePrio(0, 7, 1);
	/*
	PA_CreateSprite(0, 8, (void*)chests32x256_Sprite, OBJ_SIZE_32X32,
						1, 2, 125, 16);
	PA_SetSpriteAnim(0, 8, 0);
	PA_SetSpritePrio(0, 8, 1);
	
	PA_CreateSprite(0, 9, (void*)chests32x256_Sprite, OBJ_SIZE_32X32,
						1, 2, 220, 120);
	PA_SetSpriteHflip(0, 9, 1); //enable flip
	PA_SetSpriteAnim(0, 9, 4);
	PA_SetSpritePrio(0, 9, 1);
	
	PA_CreateSprite(0, 10, (void*)chests32x256_Sprite, OBJ_SIZE_32X32,
						1, 2, 125, 75);
	PA_SetSpriteAnim(0, 10, 0);
	PA_SetSpritePrio(0, 10, 1);
	*/
	
	slotFull[0] = false; slotFull[1] = false; slotFull[2] = false;
	slotFull[3] = false; slotFull[4] = false;
	slotX[0] = 224; slotX[1] = 192; slotX[2] = 160; slotX[3] = 128;
	slotX[4] = 96;
	slotY[0] = 159; slotY[1] = 159; slotY[2] = 159; slotY[3] = 159;
	slotY[4] = 159;
	
	//palette for enemy font
	PA_LoadSpritePal(0, 5, (void*)orangishYelloFontSprites_Pal);
	//create hp damage fonts
	PA_CreateSprite(0,20, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,21, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,22, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,23, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,24, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,25, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,26, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,27, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	PA_CreateSprite(0,28, (void*)orangishYelloFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 5, 0, 0);
	//first frame is invisible
	PA_SetSpriteAnim(0, 20, 0);
	PA_SetSpriteAnim(0, 21, 0);
	PA_SetSpriteAnim(0, 22, 0);
	PA_SetSpriteAnim(0, 23, 0);
	PA_SetSpriteAnim(0, 24, 0);
	PA_SetSpriteAnim(0, 25, 0);
	PA_SetSpriteAnim(0, 26, 0);
	PA_SetSpriteAnim(0, 27, 0);
	PA_SetSpriteAnim(0, 28, 0);

	
	
	//palette for enemy font
	PA_LoadSpritePal(0, 6, (void*)redFontSprites_Pal);
	//create hp damage fonts
	PA_CreateSprite(0,29, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,30, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,31, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,32, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,33, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,34, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,35, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,36, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	PA_CreateSprite(0,37, (void*)redFontSprites_Sprite, OBJ_SIZE_8X8,
						1, 6, 0, 0);
	//first frame is invisible
	PA_SetSpriteAnim(0, 29, 0);
	PA_SetSpriteAnim(0, 30, 0);
	PA_SetSpriteAnim(0, 31, 0);
	PA_SetSpriteAnim(0, 32, 0);
	PA_SetSpriteAnim(0, 33, 0);
	PA_SetSpriteAnim(0, 34, 0);
	PA_SetSpriteAnim(0, 35, 0);
	PA_SetSpriteAnim(0, 36, 0);
	PA_SetSpriteAnim(0, 37, 0);
	
	
	
	//TOP SCREEN SPRITES
	//-----------------------------------------------------------------
	//create sprites for top screen menu
	//PA_LoadSpritePal(1, 5, (void*)controlsMenuSprite_Pal);
	PA_LoadSpritePal(1, 5, (void*)controlsMenuSprite_Pal);
	PA_LoadSpritePal(1, 7, (void*)RedDot_Pal);  

	
	PA_CreateSprite(1, 0, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 0);
	PA_SetSpritePrio(1, 0, 2);
	PA_CreateSprite(1, 1, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 0);
	PA_SetSpritePrio(1, 1, 2);
	PA_CreateSprite(1, 2, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 0);
	PA_SetSpritePrio(1, 2, 2);
	PA_CreateSprite(1, 3, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 0);
	PA_SetSpritePrio(1, 3, 2);
	PA_CreateSprite(1, 4, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 63);
	PA_SetSpritePrio(1, 4, 2);
	PA_CreateSprite(1, 5, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 63);
	PA_SetSpritePrio(1, 5, 2);
	PA_CreateSprite(1, 6, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 63);
	PA_SetSpritePrio(1, 6, 2);
	PA_CreateSprite(1, 7, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 63);
	PA_SetSpritePrio(1, 7, 2);
	PA_CreateSprite(1, 8, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 127);
	PA_SetSpritePrio(1, 8, 2);
	PA_CreateSprite(1, 9, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 127);
	PA_SetSpritePrio(1, 9, 2);
	PA_CreateSprite(1, 10, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 127);
	PA_SetSpritePrio(1, 10, 2);
	PA_CreateSprite(1, 11, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 127);
	PA_SetSpritePrio(1, 11, 2);
	
	
	//set first frame to controls menu
	PA_SetSpriteAnim(1, 0, 1);
	PA_SetSpriteAnim(1, 1, 2);
	PA_SetSpriteAnim(1, 2, 3);
	PA_SetSpriteAnim(1, 3, 4);
	PA_SetSpriteAnim(1, 4, 5);
	PA_SetSpriteAnim(1, 5, 6);
	PA_SetSpriteAnim(1, 6, 7);
	PA_SetSpriteAnim(1, 7, 8);
	PA_SetSpriteAnim(1, 8, 9);
	PA_SetSpriteAnim(1, 9, 10);
	PA_SetSpriteAnim(1, 10, 11);
	PA_SetSpriteAnim(1, 11, 12);
	
	PA_LoadSpritePal(1, 6, (void*)numbersFontSprites_Pal);
	PA_CreateSprite(1, 12, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 56, 16);
	PA_CreateSprite(1, 13, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 64, 16);
	PA_CreateSprite(1, 14, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 56, 32);
	PA_CreateSprite(1, 15, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 64, 32);
	PA_CreateSprite(1, 16, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 72, 32);
	PA_CreateSprite(1, 17, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 80, 32);
	PA_CreateSprite(1, 18, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 88, 32);
	PA_CreateSprite(1, 19, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 184, 16);
	PA_CreateSprite(1, 20, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 192, 16);
	PA_CreateSprite(1, 21, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 200, 16);
	PA_CreateSprite(1, 22, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 216, 16);
	PA_CreateSprite(1, 23, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 224, 16);
	PA_CreateSprite(1, 24, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 232, 16);
	PA_CreateSprite(1, 25, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 184, 32);
	PA_CreateSprite(1, 26, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 192, 32);
	PA_CreateSprite(1, 27, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 200, 32);
	PA_CreateSprite(1, 28, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 216, 32);
	PA_CreateSprite(1, 29, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 224, 32);
	PA_CreateSprite(1, 30, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 232, 32);
	PA_CreateSprite(1, 31, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 184, 48);
	PA_CreateSprite(1, 32, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 192, 48);
	PA_CreateSprite(1, 33, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 200, 48);
	PA_CreateSprite(1, 34, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 216, 48);
	PA_CreateSprite(1, 35, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 224, 48);
	PA_CreateSprite(1, 36, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 232, 48);
	PA_CreateSprite(1, 37, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 200, 64);
	PA_CreateSprite(1, 38, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 208, 64);
	PA_CreateSprite(1, 39, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 216, 64);
	PA_CreateSprite(1, 40, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 200, 80);
	PA_CreateSprite(1, 41, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 208, 80);
	PA_CreateSprite(1, 42, (void*)numbersFontSprites_Sprite, OBJ_SIZE_8X16,
						1, 6, 216, 80);

	
	PA_SetSpriteAnim(1, 12, 0);
	PA_SetSpriteAnim(1, 13, 0);
	PA_SetSpriteAnim(1, 14, 0);
	PA_SetSpriteAnim(1, 15, 0);
	PA_SetSpriteAnim(1, 16, 0);
	PA_SetSpriteAnim(1, 17, 0);
	PA_SetSpriteAnim(1, 18, 0);
	PA_SetSpriteAnim(1, 19, 0);
	PA_SetSpriteAnim(1, 20, 0);
	PA_SetSpriteAnim(1, 21, 0);
	PA_SetSpriteAnim(1, 22, 0);
	PA_SetSpriteAnim(1, 23, 0);
	PA_SetSpriteAnim(1, 24, 0);
	PA_SetSpriteAnim(1, 25, 0);
	PA_SetSpriteAnim(1, 26, 0);
	PA_SetSpriteAnim(1, 27, 0);
	PA_SetSpriteAnim(1, 28, 0);
	PA_SetSpriteAnim(1, 29, 0);
	PA_SetSpriteAnim(1, 30, 0);
	PA_SetSpriteAnim(1, 31, 0);
	PA_SetSpriteAnim(1, 32, 0);
	PA_SetSpriteAnim(1, 33, 0);
	PA_SetSpriteAnim(1, 34, 0);
	PA_SetSpriteAnim(1, 35, 0);
	PA_SetSpriteAnim(1, 36, 0);
	PA_SetSpriteAnim(1, 37, 0);
	PA_SetSpriteAnim(1, 38, 0);
	PA_SetSpriteAnim(1, 39, 0);
	PA_SetSpriteAnim(1, 40, 0);
	PA_SetSpriteAnim(1, 41, 0);
	PA_SetSpriteAnim(1, 42, 0);
	
	
	PA_CreateSprite(1, 43, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 0);
	PA_SetSpritePrio(1, 43, 1);
	PA_CreateSprite(1, 44, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 0);
	PA_SetSpritePrio(1, 44, 1);
	PA_CreateSprite(1, 45, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 0);
	PA_SetSpritePrio(1, 45, 1);
	PA_CreateSprite(1, 46, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 0);
	PA_SetSpritePrio(1, 46, 1);
	PA_CreateSprite(1, 47, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 34);
	PA_SetSpritePrio(1, 47, 1);
	PA_CreateSprite(1, 48, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 34);
	PA_SetSpritePrio(1, 48, 1);
	PA_CreateSprite(1, 49, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 34);
	PA_SetSpritePrio(1, 49, 1);
	PA_CreateSprite(1, 50, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 34);
	PA_SetSpritePrio(1, 50, 1);
	PA_CreateSprite(1, 51, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 68);
	PA_SetSpritePrio(1, 51, 1);
	PA_CreateSprite(1, 52, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 68);
	PA_SetSpritePrio(1, 52, 1);
	PA_CreateSprite(1, 53, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 68);
	PA_SetSpritePrio(1, 53, 1);
	PA_CreateSprite(1, 54, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 68);
	PA_SetSpritePrio(1, 54, 1);
	PA_CreateSprite(1, 55, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 102);
	PA_SetSpritePrio(1, 55, 1);
	PA_CreateSprite(1, 56, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 102);
	PA_SetSpritePrio(1, 56, 1);
	PA_CreateSprite(1, 57, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 102);
	PA_SetSpritePrio(1, 57, 1);
	PA_CreateSprite(1, 58, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 102);
	PA_SetSpritePrio(1, 58, 1);
	//OUT OF MEMORY--BAH!!!
	/*
	PA_CreateSprite(1, 59, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 0, 136);
	PA_SetSpritePrio(1, 59, 1);
	PA_CreateSprite(1, 60, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 63, 136);
	PA_SetSpritePrio(1, 60, 1);
	PA_CreateSprite(1, 61, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 127, 136);
	PA_SetSpritePrio(1, 61, 1);
	PA_CreateSprite(1, 62, (void*)controlsMenuSprite_Sprite, OBJ_SIZE_64X64,
						1, 5, 191, 136);
	PA_SetSpritePrio(1, 62, 1);
	*/
	
	PA_SetSpriteAnim(1, 43, 0);
	PA_SetSpriteAnim(1, 44, 0);
	PA_SetSpriteAnim(1, 45, 0);
	PA_SetSpriteAnim(1, 46, 0);
	PA_SetSpriteAnim(1, 47, 0);
	PA_SetSpriteAnim(1, 48, 0);
	PA_SetSpriteAnim(1, 49, 0);
	PA_SetSpriteAnim(1, 50, 0);
	PA_SetSpriteAnim(1, 51, 0);
	PA_SetSpriteAnim(1, 52, 0);
	PA_SetSpriteAnim(1, 53, 0);
	PA_SetSpriteAnim(1, 54, 0);
	PA_SetSpriteAnim(1, 55, 0);
	PA_SetSpriteAnim(1, 56, 0);
	PA_SetSpriteAnim(1, 57, 0);
	PA_SetSpriteAnim(1, 58, 0);
	//PA_SetSpriteAnim(1, 59, 0);
	//PA_SetSpriteAnim(1, 60, 0);
	//PA_SetSpriteAnim(1, 61, 0);
	//PA_SetSpriteAnim(1, 62, 0);
	
	PA_CreateSprite(1, 63, (void*)RedDot_Sprite, OBJ_SIZE_16X16, 1, 7, 23, 95);
	PA_SetSpriteAnim(1, 63, 0);

	
	//LOAD GRAFFITI SHAPES
	//-----------------------------------------------------------------
	PA_UsePAGraffiti(0); // Do not use the provided Graffiti shapes...

	PA_RecoAddShape('a', "AAAAAAAAAAAAAAA"); // Straight right-going line
	PA_RecoAddShape('b', "111111111111111"); // Straight left-going line	
	PA_RecoAddShape('c', "IIIIIIIIIIIIIII"); // Straight up-going line	
	PA_RecoAddShape('d', "999999999999999"); // Straight down-going line
	PA_RecoAddShape('e', "EEEEEEEEEEEEEEE"); // up right slash
	PA_RecoAddShape('f', "LLLLLLLLLLLLLLL"); // dot			
	

}
	

#endif  //__INIT_H__
